#pragma once 
#include <gflags/gflags.h>
#include <odb/database.hxx> 
#include <odb/mysql/database.hxx>
#include <cstddef> // std::size_t 
#include <boost/date_time/posix_time/posix_time.hpp> 
#include <odb/nullable.hxx>
#include <odb/core.hxx>
#include <memory>
#include "logger.hpp"

namespace zhiang {
    
class ODBFactory {
public:
    static std::shared_ptr<odb::core::database> create(const std::string& user, const std::string& pswd, 
        std::string& db, const std::string& host, int port, 
        const std::string& cset, int connect_pool_count) {
        std::unique_ptr<odb::mysql::connection_pool_factory> cpf (new odb::mysql::connection_pool_factory(connect_pool_count, 0));
        std::shared_ptr<odb::mysql::database> pdb = std::make_shared<odb::mysql::database>(
            user,
            pswd,
            db,
            host,
            port,
            std::string(""),
            cset,
            0,
            std::move(cpf)
        );
        return pdb;
    }

private:

};

}